package com.tsmti.lab.service.impl;

import com.tsmti.core.common.query.data.PageImpl;
import com.tsmti.core.common.query.data.Queryable;
import com.tsmti.lab.dao.EmbedDao;
import com.tsmti.lab.dto.PimsPathologyPiecesView;
import com.tsmti.lab.service.EmbedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @auther Shiyan.shi
 * @create 2018-11-17 21:21
 */
@Service
public class EmbedServiceImpl implements EmbedService {

    @Autowired
    private EmbedDao embedDao;

    @Override
    public PimsPathologyPiecesView getDetialInfo(Long id) {
        return embedDao.getDetialInfo(id);
    }

    public int getListTotal(PimsPathologyPiecesView pimsPathologyPiecesView){
        return embedDao.getListTotal(pimsPathologyPiecesView);
    }


    @Override
    public PageImpl<PimsPathologyPiecesView> getDataByQueryCondition(PimsPathologyPiecesView pimsPathologyPiecesView , Queryable queryable, int total) {
        List<PimsPathologyPiecesView> list = embedDao.getList(pimsPathologyPiecesView,queryable);
        return new PageImpl<>(list, queryable.getPageable(), total);
    }
}
